package com.learm.singleton;

/**
 * 静态内部类，会在类加载的时候 加载进内存，但不会被实例化
 */
public class SingletonHolder {

    private  byte[] date = new byte[1024];

    private SingletonHolder(){
        System.out.println("我被实例化了");
    }

    private static class Holder{
        private static SingletonHolder instance = new SingletonHolder();
    }

    public static SingletonHolder getInstance(){
        return Holder.instance;
    }

    public static Object getInst(){
        return Holder.class;
    }
    
    public static void main(String[] args){
        String s = "开始测试";
        System.out.println(s);
        SingletonHolder.getInst();

    }


}
